package com.PVZ.model.emuns;

import com.PVZ.model.plant.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by @Author: kabuda on @Date: 2021/5/25 10:23
 */

public class Configs {
    /**
     * 冷却时间
     */
    public static Map<PlantType, Integer> cardCoolDown = new HashMap<>();

    public static Map<WeaponType,Integer> attackCoolDown = new HashMap<>();

    /**
     * 植物售价
     */
    public static Map<PlantType,Integer> golds = new HashMap<>();

    public static Map<PlantType, Plant> plantMap = new HashMap<>();

    public static Map<Object,Integer> demages = new HashMap<>();

    public static Map<ZombieType,Integer> zombieHealth = new HashMap<>();

    public static Map<PlantType,Integer> plantHealth = new HashMap<>();

    public static Map<ZombieType,Integer> zomBieSpeed = new HashMap<>();


    public Configs() {
        System.out.println("加载配置类中");


        setBulletCooldown();
        setCardCoolDown();
        setGolds();
        setDamages();
        setZombieHealth();
        setPlantHealth();

        setCoolDown();

        plantMap();
    }

    private void setZomBieSpeed(){

    }

    private void setCoolDown(){
        attackCoolDown.put(WeaponType.Bite,1);
    }

    private void setDamages(){
        demages.put(BulletType.Bean,10);
        demages.put(BulletType.Sun,0);
        demages.put(ZombieType.NormalZombie,10);
        demages.put(ZombieType.ConeheadZombie,10);
        demages.put(ZombieType.PaperZombie,10);
        demages.put(ZombieType.FootballZombie,10);
        demages.put(ZombieType.FlagZombie,10);
        demages.put(ZombieType.BucketZombie,10);
    }

    private void setPlantHealth(){
        plantHealth.put(PlantType.SunFlower,30);
        plantHealth.put(PlantType.PeaShooterSingle,30);
        plantHealth.put(PlantType.PeaShooter,30);
        plantHealth.put(PlantType.Caltrop,30);
        plantHealth.put(PlantType.Pumpkin,30);
        plantHealth.put(PlantType.Spikeweed,30);
        plantHealth.put(PlantType.PotatoMine,30);
        plantHealth.put(PlantType.CherryBomb,30);
        plantHealth.put(PlantType.Tallnut,30);
        plantHealth.put(PlantType.WallNut,30);
    }

    private void setZombieHealth(){
        zombieHealth.put(ZombieType.NormalZombie,60);
        zombieHealth.put(ZombieType.ConeheadZombie,60);
        zombieHealth.put(ZombieType.BucketZombie,60);
        zombieHealth.put(ZombieType.FootballZombie,60);
        zombieHealth.put(ZombieType.PaperZombie,60);
        zombieHealth.put(ZombieType.FlagZombie,40);
    }


    private void setBulletCooldown(){

    }

    private void setGolds(){
        golds.put(PlantType.SunFlower,50);

        golds.put(PlantType.PeaShooterSingle,100);

        golds.put(PlantType.PeaShooter,200);

        golds.put(PlantType.WallNut,500);

        golds.put(PlantType.Caltrop,500);

        golds.put(PlantType.CherryBomb,500);

        golds.put(PlantType.Tallnut,500);

        golds.put(PlantType.PotatoMine,500);

        golds.put(PlantType.Pumpkin,500);
    }

    private void setCardCoolDown(){
        cardCoolDown.put(PlantType.SunFlower, 10);
        //单枪射手
        cardCoolDown.put(PlantType.PeaShooterSingle,5);

        //双枪射手
        cardCoolDown.put(PlantType.PeaShooter,3);

        //南瓜保护
        cardCoolDown.put(PlantType.Pumpkin, 3);

        //小坚果
        cardCoolDown.put(PlantType.WallNut,3);

        //土豆雷
        cardCoolDown.put(PlantType.PotatoMine,3);

        //高坚果
        cardCoolDown.put(PlantType.Tallnut,3);

        //地刺
        cardCoolDown.put(PlantType.Caltrop, 3);

        //樱桃炸弹
        cardCoolDown.put(PlantType.CherryBomb,3);
    }

    private void plantMap(){
        plantMap.put(PlantType.SunFlower, new SunFlower());
        plantMap.put(PlantType.PeaShooterSingle, new PeaShooterSingle());
        plantMap.put(PlantType.PeaShooter, new PeaShooter());
        plantMap.put(PlantType.WallNut, new WallNut());
        plantMap.put(PlantType.Caltrop, new Caltrop());
        plantMap.put(PlantType.CherryBomb, new CherryBomb());
        plantMap.put(PlantType.Tallnut, new Tallnut());
        plantMap.put(PlantType.PotatoMine, new PotatoMine());
        plantMap.put(PlantType.Pumpkin, new Pumpkin());
    }
}
